package com.edushare.common.vo;

import com.edushare.common.vo.auto._EntityAttributes;

public class EntityAttributes extends _EntityAttributes {
	
	public static final int OWNER_UNIV 		= 10;
	public static final int OWNER_DEPT		= 20;
	public static final int OWNER_COURSE	= 30;
	public static final int OWNER_INST 		= 40;
	
	public static final int STRING_VAL		= 10;
	public static final int INTEGER_VAL		= 20;
	
	
	public String getAsString() {
		if(getAttribValType() == STRING_VAL)
			return getAttribStrVal();
		else
			return getAttribIntVal().toString();
	}
	
	public void setAsString(String val){
		setAttribValType(STRING_VAL);
		setAttribStrVal(val);
	}
	
	public int getAsInt(){
		if(getAttribValType() == INTEGER_VAL)
			return getAttribIntVal();
		else 
			return 0;
	}
	
	public void setAsInt(int val){
		setAttribValType(INTEGER_VAL);
		setAttribIntVal(val);
	}
	
}
